package com.ruoyi.appuser.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.appuser.domain.AppuserPrizeRecord;
import com.ruoyi.appuser.mapper.AppuserPrizeRecordMapper;
import com.ruoyi.appuser.service.IAppuserPrizeRecordService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 用户获得奖品记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-14
 */
@Service
public class AppuserPrizeRecordServiceImpl extends ServiceImpl<AppuserPrizeRecordMapper,AppuserPrizeRecord> implements IAppuserPrizeRecordService
{
    @Resource
    private AppuserPrizeRecordMapper appuserPrizeRecordMapper;

    /**
     * 查询用户获得奖品记录
     *
     * @param id 用户获得奖品记录主键
     * @return 用户获得奖品记录
     */
    @Override
    public AppuserPrizeRecord selectAppuserPrizeRecordById(String id)
    {
        return appuserPrizeRecordMapper.selectAppuserPrizeRecordById(id);
    }

    /**
     * 查询用户获得奖品记录列表
     *
     * @param appuserPrizeRecord 用户获得奖品记录
     * @return 用户获得奖品记录
     */
    @Override
    public List<AppuserPrizeRecord> selectAppuserPrizeRecordList(AppuserPrizeRecord appuserPrizeRecord)
    {
        return appuserPrizeRecordMapper.selectAppuserPrizeRecordList(appuserPrizeRecord);
    }

    /**
     * 新增用户获得奖品记录
     *
     * @param appuserPrizeRecord 用户获得奖品记录
     * @return 结果
     */
    @Override
    public int insertAppuserPrizeRecord(AppuserPrizeRecord appuserPrizeRecord)
    {
        appuserPrizeRecord.setCreateTime(DateUtils.getNowDate());
        return appuserPrizeRecordMapper.insertAppuserPrizeRecord(appuserPrizeRecord);
    }

    /**
     * 修改用户获得奖品记录
     *
     * @param appuserPrizeRecord 用户获得奖品记录
     * @return 结果
     */
    @Override
    public int updateAppuserPrizeRecord(AppuserPrizeRecord appuserPrizeRecord)
    {
        return appuserPrizeRecordMapper.updateAppuserPrizeRecord(appuserPrizeRecord);
    }

    /**
     * 批量删除用户获得奖品记录
     *
     * @param ids 需要删除的用户获得奖品记录主键
     * @return 结果
     */
    @Override
    public int deleteAppuserPrizeRecordByIds(String[] ids)
    {
        return appuserPrizeRecordMapper.deleteAppuserPrizeRecordByIds(ids);
    }

    /**
     * 删除用户获得奖品记录信息
     *
     * @param id 用户获得奖品记录主键
     * @return 结果
     */
    @Override
    public int deleteAppuserPrizeRecordById(String id)
    {
        return appuserPrizeRecordMapper.deleteAppuserPrizeRecordById(id);
    }
}
